package nju.jun.reader.tieba.model;

/**
 * TODO: Divide this class into volume and chapter?
 * 
 * @author gujun
 *
 */
public class TiebaNovelChapter {
	
	private TiebaNovel novel;
	
	private int volumeNumber;
	
	private String volumeName;
	
	private int chapterNumber;
	
	private String chapterName;
	
	private String content;
	
	private String url;
	
	public TiebaNovel getNovel() {
		return novel;
	}

	public void setNovel(TiebaNovel novel) {
		this.novel = novel;
	}

	public int getVolumeNumber() {
		return volumeNumber;
	}

	public void setVolumeNumber(int volumeNumber) {
		this.volumeNumber = volumeNumber;
	}

	public String getVolumeName() {
		return volumeName;
	}

	public void setVolumeName(String volumeName) {
		this.volumeName = volumeName;
	}

	public int getChapterNumber() {
		return chapterNumber;
	}

	public void setChapterNumber(int chapterNumber) {
		this.chapterNumber = chapterNumber;
	}
	
	public String getChapterName() {
		return chapterName;
	}

	public void setChapterName(String title) {
		this.chapterName = title;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}
	
	public String getVolumeDirStr() {
		if (null == this.novel) {
			return null;
		}
		return this.novel.getStorageDirectory() + "/" + this.volumeNumber + "_" + this.volumeName;
	}
	
	public String getChapterFileStr() {
		String volumeDir = getVolumeDirStr();
		if (null == volumeDir) {
			return null;
		}
		return volumeDir + "/" + this.chapterNumber + "_" + this.chapterName;
	}
	
	public boolean equals(TiebaNovelChapter another) {
		if (null == another) {
			return false;
		}
		if (this.chapterNumber == another.chapterNumber) {
			return true;
		}
		return false;
	}
	
}
